/**
 * Created by Smile on 2018/12/20.
 */

var vm = new Vue({
    el:'#rrapp',
    data:function(){
        return {

        }
    },
    methods: {
        layerAlertOne:function(){
            layer.alert('提示信息');
        },
        layerAlertTwoSuccess:function(){
            layer.alert('提示信息',{icon: 1});
        },
        layerAlertTwoFail:function(){
            layer.alert('提示信息',{icon: 2});
        },
        layerAlertTwoWarning:function(){
            layer.alert('提示信息',{icon: 0});
        },
        layerAlertThree:function(){
            layer.alert('提示信息',{icon: 1}, function(index){
                //do something
                console.log('点击了确定')
                layer.close(index);
            });
        },
        layerConfirmOne:function(){
            layer.confirm('确定删除？', {icon: 3, title:'提示'}, function(index){
                //do something
                console.log('确定');
                layer.close(index);
            })
        },
        layerMsgOne:function(){
            layer.msg('只想弱弱提示');
        },
        layerMsgTwo:function(){
            layer.msg('有表情地提示', {icon: 6});
        },
        layerMsgThree:function(){
            layer.msg('关闭之后回调', {icon: 5},function(){
                console.log('已关闭')
            });
        },
        layerMsgFour:function(){
            layer.msg('自动关闭', {
                icon: 4,
                time: 2000 //2秒关闭（如果不配置，默认是3秒）
            });
        },
        layerLoadOne:function(){
            var index = layer.load();
            setTimeout(function(){
                layer.close(index);
            },3000)
        },
        layerLoadTwo:function(){
            var index = layer.load(1);
            setTimeout(function(){
                layer.close(index);
            },3000)
        },
        layerLoadThree:function(){
            var index = layer.load(2, {time: 10*1000});
            setTimeout(function(){
                layer.close(index);
            },3000)
        },
        layerOpenOne:function(){
            layer.open({
                type: 1,
                title: "弹窗标题",
                area: ["80%", "70%"],
                content: $("#layer")
            });
        },
        layerOpenTwo:function(){
            layer.open({
                type: 1,
                title: "弹窗标题",
                maxmin:true,
                area: ["80%", "70%"],
                content: $("#layer")
            });
        },
        layerOpenThree:function(){
            layer.open({
                type: 1,
                title: "弹窗标题",
                maxmin:true,
                area: ["80%", "70%"],
                content: $("#layer1"),
                btn: ['确定', '取消','重置'],
                yes: function(index, layero){
                    console.log('确定回调')
                },
                btn2: function(index, layero){
                    console.log('取消回调')
                },
                btn3: function(index, layero){
                    $.formReset('myform');
                    return false;
                },
                cancel: function(){
                    console.log('右上角回调')
                }
            });


        }
    }
});